import { ApiProperty } from "@nestjs/swagger";

class UserInfo {
  @ApiProperty({ description: '用户id', example: 1 })
  id: number;
  
  @ApiProperty({ description: '用户名', example: 'admin' })
  username: string;

  @ApiProperty({ description: '用户昵称', example: '管理员' })
  nickName: string;

  @ApiProperty({ description: '用户邮箱', example: 'admin@admin.com' })
  email: string;
  @ApiProperty({ description: '用户头像', example: 'http://www.example.com/avatar.png' })
  headPic: string;

  @ApiProperty({ description: '用户手机号', example: '13812345678' })
  phoneNumber: string;
  @ApiProperty({ description: '用户是否被冻结', example: true })
  isFrozen: boolean;

  @ApiProperty({ description: '用户是否是管理员', example: true })
  isAdmin: boolean;

  @ApiProperty({ description: '创建时间', example: '2022-01-01 00:00:00' })
  createTime: number|Date;

  @ApiProperty({description:'用户角色',example:['admin']})
  roles: string[];

  @ApiProperty({description:'用户权限',example:'query_aaa'})
  permissions: string[];
}
export class LoginUserVo {
  @ApiProperty()
  userInfo: UserInfo;
  @ApiProperty({description:'用户登录token'})
  accessToken: string;
  @ApiProperty({description:'用户刷新token'})
  refreshToken: string;
}
export class UserDetailVo {
  @ApiProperty({ description: '用户id', example: 1 })
  id: number;
  @ApiProperty({ description: '用户名', example: 'admin' })
  username: string;
  @ApiProperty({ description: '用户昵称', example: '管理员' })
  nickName: string;
  @ApiProperty({ description: '用户邮箱', example: 'admin@admin.com' })
  email: string;
  @ApiProperty({ description: '用户头像', example: 'http://www.example.com/avatar.png' })
  headPic: string;
  @ApiProperty({ description: '用户手机号', example: '13812345678' })
  phoneNumber: string;
  @ApiProperty({ description: '用户是否被冻结', example: true })
  isFrozen: boolean;
  @ApiProperty({ description: '创建时间', example: '2022-01-01 00:00:00' })
  createTime: Date;
}
export class RefreshTokenVo {
  @ApiProperty()
  access_token: string;

  @ApiProperty()
  refresh_token: string;
}